package com.open.party.cloud.view.home.juBao

import android.os.Bundle
import android.view.View
import cn.android.x.parent.AppTitleBaseActivity
import com.open.party.cloud.R
import com.open.party.cloud.model.JuBaoChaXunBean
import com.sinothk.android.utils.XUtils
import kotlinx.android.synthetic.main.activity_ju_bao_12380_main_area.*

class JuBao12380MainAreaActivity : AppTitleBaseActivity(), View.OnClickListener {

    var result: JuBaoChaXunBean? = null

    override fun getLayoutResId(): Int = R.layout.activity_ju_bao_12380_main_area

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setViewTitle("12380举报平台")

        liuPanShuiItem.setOnClickListener(this)
        liuZhiTeQuItem.setOnClickListener(this)
        panZhouShiItem.setOnClickListener(this)
        shuiChengXianItem.setOnClickListener(this)
        zhongShanQuItem.setOnClickListener(this)

        fanKuiItem.setOnClickListener {
            XUtils.intent().openActivity(this, JuBao12380ChaXunSearchActivity::class.java)
                .start()
        }
    }

    override fun onClick(v: View?) {
        var area = ""
        when (v) {
            liuPanShuiItem -> {
                area = "六盘水市"
            }
            liuZhiTeQuItem -> {
                area = "六枝特区"
            }
            panZhouShiItem -> {
                area = "盘州市"
            }
            shuiChengXianItem -> {
                area = "水城区"
            }
            zhongShanQuItem -> {
                area = "钟山区"
            }
        }

        XUtils.intent().openActivity(this, JuBao12380RuXuZhiActivity::class.java)
            .putStringExtra("area", area)
            .start()
    }
}